package com.microframework.base.core.model.options;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;

@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class TreeNode<T> {
	
	@NonNull
	@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
	private String id;
	
	@NonNull
	@Schema(description = "上级Id", requiredMode = Schema.RequiredMode.REQUIRED)
	private String parentId;
	
	@NonNull
	@Schema(description = "标签", requiredMode = Schema.RequiredMode.REQUIRED)
	private String label;
	
	
	@NonNull
	@Schema(description = "子节点", requiredMode = Schema.RequiredMode.REQUIRED)
	private List<? extends TreeNode<T>> children;
	
	
	@NonNull
	@Schema(description = "子节点", requiredMode = Schema.RequiredMode.REQUIRED)
	private T extend;
	
	
}
